package com.pand.model.vehicle;

import com.pand.model.config.BluetoothConfig;
import com.pand.model.config.VkeyConfig;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @ClassName: VehicleRunData
 * @Description: 车辆运行数据
 * @author zouyan
 * @date 2016年4月15日 下午2:16:13
 *
 */
public class VehicleRunData implements Serializable{

	/**
	 * @Fields serialVersionUID :
	 */
	private static final long serialVersionUID = 1L;

	/**
	 *  车辆id
	 */
	private Long id;

	/**
	 * 车牌号
	 */
	private String license;

	/**
	 * 在线状态
	 */
	private Integer deviceStatus;

	/**
	 * 车载设备信号量
	 */
	private Integer gprsrssi;

	/**
	 * 车门车锁状态
	 */
	private Integer doorstatus;

	/**
	 * 点火钥匙位置
	 */
	private Integer acc;

	/**
	 * 手刹状态
	 */
	private Integer handbrakestatus;

	/**
	 * 经度
	 */
	private Double longtitude;

	/**
	 * 纬度
	 */
	private Double latitude;

	/**
	 * 蓝牙2.1配置
	 */
	private String bluetoothSsid;

	/**
	 * pin码
	 */
	private String bluetoothPwd;

	/**
	 * 蓝牙4.1配置
	 */
	private String wifiSsid;

	/**
	 * VKEY配置
	 */
	private String vkey;

	/**
	 * 档位
	 */
	private Integer dw;

	/**
	 * 限速状态
	 */
	private Integer xszt;

	/**
	 * 电池电量
	 */
	private Double dcdl;

	/**
	 * 续航里程
	 */
	private Double xhlc;

	/**
	 * 小计里程
	 */
	private Double trip;

	/**
	 * 累计里程
	 */
	private Double odo;

	/**
	 * 档位名称
	 */
	private String dwName;

	/**
	 * 限速状态名称
	 */
	private String speedLimitStateName;

	/**
	 * 数据更新时间
	 */
	private Date updateTime;

	/**
	 * 数据更新时间
	 */
	private Date pushTime;
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLicense() {
		return license;
	}

	public void setLicense(String license) {
		this.license = license;
	}

	public Integer getDeviceStatus() {
		return deviceStatus;
	}

	public void setDeviceStatus(Integer deviceStatus) {
		this.deviceStatus = deviceStatus;
	}

	public Integer getGprsrssi() {
		return gprsrssi;
	}

	public void setGprsrssi(Integer gprsrssi) {
		this.gprsrssi = gprsrssi;
	}

	public Integer getDoorstatus() {
		return doorstatus;
	}

	public void setDoorstatus(Integer doorstatus) {
		this.doorstatus = doorstatus;
	}

	public Integer getAcc() {
		return acc;
	}

	public void setAcc(Integer acc) {
		this.acc = acc;
	}

	public Integer getHandbrakestatus() {
		return handbrakestatus;
	}

	public void setHandbrakestatus(Integer handbrakestatus) {
		this.handbrakestatus = handbrakestatus;
	}

	public Double getLongtitude() {
		return longtitude;
	}

	public void setLongtitude(Double longtitude) {
		this.longtitude = longtitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public String getBluetoothSsid() {
		return bluetoothSsid;
	}

	public void setBluetoothSsid(String bluetoothSsid) {
		this.bluetoothSsid = bluetoothSsid;
	}

	public String getBluetoothPwd() {
		return bluetoothPwd;
	}

	public void setBluetoothPwd(String bluetoothPwd) {
		this.bluetoothPwd = bluetoothPwd;
	}

	public String getWifiSsid() {
		return wifiSsid;
	}

	public void setWifiSsid(String wifiSsid) {
		this.wifiSsid = wifiSsid;
	}

	public String getVkey() {
		return vkey;
	}

	public void setVkey(String vkey) {
		this.vkey = vkey;
	}

	public Integer getDw() {
		return dw;
	}

	public void setDw(Integer dw) {
		this.dw = dw;
	}

	public Integer getXszt() {
		return xszt;
	}

	public void setXszt(Integer xszt) {
		this.xszt = xszt;
	}

	public Double getDcdl() {
		return dcdl;
	}

	public void setDcdl(Double dcdl) {
		this.dcdl = dcdl;
	}

	public Double getXhlc() {
		return xhlc;
	}

	public void setXhlc(Double xhlc) {
		this.xhlc = xhlc;
	}

	public Double getTrip() {
		return trip;
	}

	public void setTrip(Double trip) {
		this.trip = trip;
	}

	public Double getOdo() {
		return odo;
	}

	public void setOdo(Double odo) {
		this.odo = odo;
	}

	public String getDwName() {
		return dwName;
	}

	public void setDwName(String dwName) {
		this.dwName = dwName;
	}

	public String getSpeedLimitStateName() {
		if(xszt != null){
			if(xszt==1){
				speedLimitStateName = "限速";
			}else{
				speedLimitStateName = "不限速";
			}
		}else {
			speedLimitStateName = "未知";
		}
		return speedLimitStateName;
	}

	public void setSpeedLimitStateName(String speedLimitStateName) {
		this.speedLimitStateName = speedLimitStateName;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getPushTime() {
		return pushTime;
	}

	public void setPushTime(Date pushTime) {
		this.pushTime = pushTime;
	}

	public void copyBean(VehicleRealData vehicleRealData, VehicleLocation vehicleLocation, BluetoothConfig bluetoothConfig, VkeyConfig vkeyConfig){
		if(vehicleRealData!=null){
			this.setDeviceStatus(vehicleRealData.getOnline());//在线状态
			this.setDoorstatus(vehicleRealData.getDoor()); //车门状态
			this.setAcc(vehicleRealData.getAcc()); //点火钥匙位置
			this.setHandbrakestatus(vehicleRealData.getHandbrake()); //手刹状态
			this.setDwName(vehicleRealData.getGear()); //档位
			this.setXszt(vehicleRealData.getSpeedLimitState()); //限速状态
			this.setDcdl(vehicleRealData.getSoc()); //电池电量
			this.setXhlc(vehicleRealData.getRange()); //续航里程
			this.setOdo(vehicleRealData.getOdo()); //累计里程
		}

		if(vkeyConfig!=null)
			this.setVkey(vkeyConfig.getVkey()); //vkey 配置

		if(vehicleLocation!=null){
			this.setLatitude(vehicleLocation.getLatitude()); //车辆纬度
			this.setLongtitude(vehicleLocation.getLongtitude()); //车辆经度
		}

		if(bluetoothConfig!=null){
			this.setBluetoothSsid(bluetoothConfig.getBt2Ssid()); //蓝牙2.1配置
			this.setBluetoothPwd(bluetoothConfig.getBt2Pwd()); //pin码
			this.setWifiSsid(bluetoothConfig.getBt4Ssid()); //蓝牙4.1配置

		}

	}




}
